'''
@author: zhangkai
@license: (C) Copyright 2017-2023
@contact: jeffcobile@gmail.com
@Software : PyCharm
@file: backbone_zoo.py
@time: 2020-05-29 11:17:12
@desc: 
'''
import torch
from jjzhk.register import Registry

BACKBONE_ZOO = Registry("BACKBONE")


def get_backbone(cfg, backbone):
    """
    Built the backbone model, defined by `cfg.MODEL.BACKBONE`.
    """
    model = BACKBONE_ZOO.get(backbone)(cfg)
    return model


class BackboneSeg(torch.nn.Module):
    def __init__(self, cfg):
        super(BackboneSeg, self).__init__()
        self.cfg = cfg

    def __call__(self,*args, **kwargs):
        return self._create_network_()

    def _create_network_(self):
        pass

    def load_init_weights(self, weights):
        pass

